package com.lin.factory;
/**
 * 工厂制造的具体的产品
 * 
 * 纽约风味芝士披萨
 * 
 * @author linfenliang
 *
 */
class NYStyleCheesePizza extends Pizza {
	PizzaIngredientFactory factory;

	public NYStyleCheesePizza(PizzaIngredientFactory factory) {
		this.name = "NYStyleCheesePizza";
		this.factory = factory;
	}
	@Override
	void prepare() {//披萨的成分由抽象工厂方法产生
		System.out.println("preparing "+this.name);
		this.dough = factory.createDough();
		this.sauce = factory.createSauce();
		this.cheese = factory.createCheese();
		
	}
}
class NYStyleVeggiePizza extends Pizza{
	PizzaIngredientFactory factory;

	public NYStyleVeggiePizza(PizzaIngredientFactory factory) {
		this.name = "NYStyleVeggiePizza";
		this.factory = factory;
	}
	@Override
	void prepare() {
		System.out.println("preparing "+this.name);
		this.dough = factory.createDough();
		this.sauce = factory.createSauce();
		this.cheese = factory.createCheese();
		
	}
}
class ChicagoStyleCheesePizza extends Pizza{
	PizzaIngredientFactory factory;

	public ChicagoStyleCheesePizza(PizzaIngredientFactory factory) {
		this.name = "ChicagoStyleCheesePizza";
		this.factory = factory;
	}
	@Override
	void prepare() {
		System.out.println("preparing "+this.name);
		this.dough = factory.createDough();
		this.sauce = factory.createSauce();
		this.cheese = factory.createCheese();
		
	}
	@Override
	void cut() {
		System.out.println("Cutting the pizza intosquare slices");
	}
}